//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml
{
    public class Shadow: ShapeElement
    {
        internal const string xmlName = "shadow";
        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read(VmlConstants.VmlNamespace + xmlName))
            {
                Id = c.GetOptionalString("id");
                IsEnabled = c.GetOptionalBoolean("on", false);
                Type = c.GetOptionalEnum<ShadowType>("type");
                Obscured = c.GetOptionalBoolean("obscured", false);
                Color = c.GetOptionalString("color");
                Opacity = c.GetOptionalString("opacity");
                Offset = c.GetOptionalString("offset");
                Color2 = c.GetOptionalString("color2");
                Offset2 = c.GetOptionalString("offset2");
                Origin = c.GetOptionalString("origin");
                Matrix = c.GetOptionalString("matrix");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (WriteContext c = context.Write (VmlConstants.VmlNamespace + xmlName))
            {
                c.SetOptionalString("id", Id);
                c.SetOptionalBoolean("on", IsEnabled, false);
                c.SetOptionalEnum("type", Type);
                c.SetOptionalBoolean("obscured", Obscured, false);
                c.SetOptionalString("color", Color);
                c.SetOptionalString("opacity", Opacity);
                c.SetOptionalString("offset", Offset);
                c.SetOptionalString("color2", Color2);
                c.SetOptionalString("offset2", Offset2);
                c.SetOptionalString("origin", Origin);
                c.SetOptionalString("matrix", Matrix);
            }
        }

        private string _matrix;

        public string Matrix
        {
            get { return _matrix; }
            set { _matrix = value; }
        }
	

        private string _origin;

        public string Origin
        {
            get { return _origin; }
            set { _origin = value; }
        }
	

        private string _offset2;

        public string Offset2
        {
            get { return _offset2; }
            set { _offset2 = value; }
        }
	

        private string _color2;

        public string Color2
        {
            get { return _color2; }
            set { _color2 = value; }
        }
	

        private string _offset;

        public string Offset
        {
            get { return _offset; }
            set { _offset = value; }
        }
	

        private string _opacity;

        public string Opacity
        {
            get { return _opacity; }
            set { _opacity = value; }
        }
	

        private string _color;

        public string Color
        {
            get { return _color; }
            set { _color = value; }
        }
	

        private bool _obscured;

        public bool Obscured
        {
            get { return _obscured; }
            set { _obscured = value; }
        }
	
        private ShadowType? _type;

        public ShadowType? Type
        {
            get { return _type; }
            set { _type = value; }
        }
	

        private bool _on;

        public bool IsEnabled
        {
            get { return _on; }
            set { _on = value; }
        }
	

        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }
	
    }
}
